home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-10-06 | 1.3 KB | 53 lines | [TEXT/MPS ] |
- # NewBuild - build the specified project
- #
- # Usage:
- # NewBuild program [options…] > log
- #
- # The NewBuild script builds the specified program (or target).
- #
- # Make is used to generate the build commands. If file <program>.make
- # exists it is used as the makefile. If not, file MakeFile is used.
- #
- # The options specified are passed directly to Make, and control the
- # generation of the build commands.
- #
- # Modified from BuildProgram, to create the object folders
-
- Set Exit 1
-
- # Find the program parameter.
- Unset program
- For i In {"Parameters"}
- If "{i}" !~ /-≈/
- Set program "{i}"
- Break
- End
- End
- If "{program}" == ""
- Echo "### {0} - Specify a program to build." > Dev:StdErr
- Echo "# Usage - {0} program [options…]" > Dev:StdErr
- Exit 1
- End
-
- # Select the makefile.
- Set makefile `(Files -t TEXT "{program}".make || ∂
- Files -t TEXT MakeFile || Echo '""') ≥ Dev:Null`
- If "{makefile}" == ""
- Echo "### {0} - No makefile exists for {program}." > Dev:StdErr
- Exit 1
- End
-
- # Create the object code folder (if necessary)
- if !`Exists -d ":Objects:"`
- NewFolder Objects
- End
- if !`Exists -d ":DebugObjects:"`
- NewFolder DebugObjects
- End
-
- # Run Make, then execute its output.
- Make {"Parameters"} -f "{makefile}" > "{program}".makeout
- Execute "{program}".makeout > Dev:StdErr # > "{program}.makeerr"
- Delete "{program}".makeout
- Echo "# Build done."
-